using System;
using WCSFContrib.PageFlow;
using PageFlowWithShoppingCartQuickstart.Store.BusinessLogic;
using Page=System.Web.UI.Page;
using System.Web.Security;

public partial class Cart : Page
{
	protected void Page_Load(object sender, EventArgs e)
	{
		if (!IsPostBack)
		{
			cartGridView.DataSource = Controller.GetCartDetail();
			cartGridView.DataKeyNames = new string[1] {"ProductId"};
			cartGridView.DataBind();
		}
	}

	protected void browseCatalogButton_Click(object sender, EventArgs e)
	{
		Controller.BrowseCatalog();
	}

	public StoreController Controller
	{
		get { return new StoreController(PageFlowDirectory.Provider); }
	}

	protected void continueLater_Click(object sender, EventArgs e)
	{
		Controller.SuspendShopping();
        FormsAuthentication.SignOut();
        FormsAuthentication.RedirectToLoginPage();
	}

	protected void checkoutOrder_Click(object sender, EventArgs e)
	{
		Controller.CheckoutOrder();
	}
}